home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1995 April / Internet Tools.iso / mail / sendmail / UCB / sendmail.8.6.11.patch.Z / sendmail.8.6.11.patch
Encoding:
Text File  |  1995-03-08  |  24.4 KB  |  1,019 lines

  1. *** RELEASE_NOTES.OLD    Fri Feb 10 09:55:32 1995
  2. --- RELEASE_NOTES    Wed Mar  8 14:25:29 1995
  3. ***************
  4. *** 1,10 ****
  5.               SENDMAIL RELEASE NOTES
  6. !          @(#)RELEASE_NOTES    8.6.10.2 (Berkeley) 2/10/95
  7.   
  8.   This listing shows the version of the sendmail binary, the version
  9.   of the sendmail configuration files, the date of release, and a
  10.   summary of the changes in that release.
  11.   
  12.   8.6.10/8.6.10    95/02/10
  13.       SECURITY: Diagnose bogus values to some command line flags that
  14.           could allow trash to get into headers and qf files.
  15. --- 1,45 ----
  16.               SENDMAIL RELEASE NOTES
  17. !          @(#)RELEASE_NOTES    8.6.11.1 (Berkeley) 3/8/95
  18.   
  19.   This listing shows the version of the sendmail binary, the version
  20.   of the sendmail configuration files, the date of release, and a
  21.   summary of the changes in that release.
  22.   
  23. + 8.6.11/8.6.11    95/03/08
  24. +     The ``possible attack'' message would be logged more often
  25. +         than necessary if you are using Pine as a user agent.
  26. +     The wrong host would be reported in the ``possible attack''
  27. +         message when attempted from IDENT.
  28. +     In some cases the syslog buffer could be overflowed when
  29. +         reporting the ``possible attack'' message.  This can
  30. +         cause denial of service attacks.  Truncate the message
  31. +         to 80 characters to prevent this problem.
  32. +     When reading the IDENT response a loop is needed around the
  33. +         read from the network to ensure that you don't get
  34. +         partial lines.
  35. +     Password entries without any shell listed (that is, a null
  36. +         shell) wouldn't match as "ok".  Problem noted by
  37. +         Rob McMahon.
  38. +     When running BIND 4.9.x a problem could occur because the
  39. +         _res.options field is initialized differently than it
  40. +         was historically -- this requires that sendmail call
  41. +         res_init before it tweaks any bits.
  42. +     Fix an incompatibility in openxscript() between the file open mode
  43. +         and the stdio mode passed to fdopen.  This caused UnixWare
  44. +         2.0 to have conniptions.  Fix from Martin Sohnius of
  45. +         Novell Labs Europe.
  46. +     Fix problem with static linking of local getopt routine when
  47. +         using GNU's ld command.  Fix from John Kennedy of
  48. +         Cal State Chico.
  49. +     It was possible to turn off privacy flags.  Problem noted by
  50. +         *Hobbit*.
  51. +     Be more paranoid about writing files.  Suggestions by *Hobbit*
  52. +         and Liudvikas Bukys.
  53. +     MAKEMAP: fixes for 64 bit machines (DEC Alphas in particular)
  54. +         from Spider Boardman.
  55. +     CONFIG: No changes (version number only, to keep it in sync
  56. +         with the binaries).
  57.   8.6.10/8.6.10    95/02/10
  58.       SECURITY: Diagnose bogus values to some command line flags that
  59.           could allow trash to get into headers and qf files.
  60. ***************
  61. *** 46,51 ****
  62. --- 81,88 ----
  63.           some cases, buffers could get trashed by map lookups
  64.           causing it to do unexpected things.  This also simplifies
  65.           some of the map code.
  66. +     CONFIG: No changes (version number only, to keep it in sync
  67. +         with the binaries).
  68.   
  69.   8.6.9/8.6.9    94/04/19
  70.       Do all mail delivery completely disconnected from any terminal.
  71. *** cf/m4/version.m4.OLD    Fri Feb 10 08:14:41 1995
  72. --- cf/m4/version.m4    Sat Mar  4 08:42:38 1995
  73. ***************
  74. *** 32,39 ****
  75.   # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  76.   # SUCH DAMAGE.
  77.   #
  78. ! VERSIONID(`@(#)version.m4    8.6.10.1 (Berkeley) 2/10/95')
  79.   #
  80.   divert(0)
  81.   # Configuration version number
  82. ! DZ8.6.10
  83. --- 32,39 ----
  84.   # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  85.   # SUCH DAMAGE.
  86.   #
  87. ! VERSIONID(`@(#)version.m4    8.6.11.1 (Berkeley) 3/4/95')
  88.   #
  89.   divert(0)
  90.   # Configuration version number
  91. ! DZ8.6.11
  92. *** makemap/makemap.c.OLD    Thu Feb  9 16:54:35 1995
  93. --- makemap/makemap.c    Mon Mar  6 13:26:59 1995
  94. ***************
  95. *** 33,39 ****
  96.    */
  97.   
  98.   #ifndef lint
  99. ! static char sccsid[] = "@(#)makemap.c    8.6 (Berkeley) 11/22/93";
  100.   #endif /* not lint */
  101.   
  102.   #include <stdio.h>
  103. --- 33,39 ----
  104.    */
  105.   
  106.   #ifndef lint
  107. ! static char sccsid[] = "@(#)makemap.c    8.6.1.1 (Berkeley) 3/6/95";
  108.   #endif /* not lint */
  109.   
  110.   #include <stdio.h>
  111. ***************
  112. *** 66,72 ****
  113.       struct
  114.       {
  115.           char    *data;
  116. !         int    size;
  117.       } xx;
  118.   };
  119.   
  120. --- 66,72 ----
  121.       struct
  122.       {
  123.           char    *data;
  124. !         size_t    size;
  125.       } xx;
  126.   };
  127.   
  128. ***************
  129. *** 226,235 ****
  130. --- 226,239 ----
  131.   #ifdef NEWDB
  132.         case T_HASH:
  133.           dbp.db = dbopen(mapname, mode, 0644, DB_HASH, NULL);
  134. +         if (dbp.db != NULL)
  135. +             (void) (*dbp.db->sync)(dbp.db, 0);
  136.           break;
  137.   
  138.         case T_BTREE:
  139.           dbp.db = dbopen(mapname, mode, 0644, DB_BTREE, NULL);
  140. +         if (dbp.db != NULL)
  141. +             (void) (*dbp.db->sync)(dbp.db, 0);
  142.           break;
  143.   #endif
  144.   
  145. *** src/READ_ME.OLD    Thu Feb  9 12:21:39 1995
  146. --- src/READ_ME    Sun Mar  5 12:52:35 1995
  147. ***************
  148. *** 30,36 ****
  149.   # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  150.   # SUCH DAMAGE.
  151.   #
  152. ! #    @(#)READ_ME    8.61 (Berkeley) 4/17/94
  153.   #
  154.   
  155.   This directory contains the source files for sendmail.
  156. --- 30,36 ----
  157.   # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  158.   # SUCH DAMAGE.
  159.   #
  160. ! #    @(#)READ_ME    8.61.1.1 (Berkeley) 3/5/95
  161.   #
  162.   
  163.   This directory contains the source files for sendmail.
  164. ***************
  165. *** 666,671 ****
  166. --- 666,682 ----
  167.       the flock() system call gives errors.  If you are running .14,
  168.       you must not use flock.  You can do this with -DHASFLOCK=0.
  169.   
  170. +     Around the inclusion of bind-4.9.3 & linux libc-4.6.20, the
  171. +     initialization of the _res structure changed.  If /etc/hosts.conf
  172. +     was configured as "hosts, bind" the resolver code could return
  173. +     "Name server failure" errors.  This is supposedly fixed in
  174. +     later versions of libc (>= 4.6.29?), and later versions of
  175. +     sendmail (> 8.6.10) try to work around the problem.
  176. +     Some older versions (< 4.6.20?) of the libc/include files conflict
  177. +     with sendmail's version of cdefs.h.  Deleting sendmail's version
  178. +     on those systems should be non-harmful, and new versions don't care.
  179.   AIX
  180.       This version of sendmail does not support MB, MG, and MR resource
  181.       records, which are supported by AIX sendmail.
  182. ***************
  183. *** 869,872 ****
  184.   
  185.   Eric Allman
  186.   
  187. ! (Version 8.61, last update 4/17/94 07:05:32)
  188. --- 880,883 ----
  189.   
  190.   Eric Allman
  191.   
  192. ! (Version 8.61.1.1, last update 3/5/95 12:52:16)
  193. *** src/conf.c.OLD    Thu Feb  9 12:21:59 1995
  194. --- src/conf.c    Tue Mar  7 09:49:01 1995
  195. ***************
  196. *** 33,39 ****
  197.    */
  198.   
  199.   #ifndef lint
  200. ! static char sccsid[] = "@(#)conf.c    8.89 (Berkeley) 4/18/94";
  201.   #endif /* not lint */
  202.   
  203.   # include "sendmail.h"
  204. --- 33,39 ----
  205.    */
  206.   
  207.   #ifndef lint
  208. ! static char sccsid[] = "@(#)conf.c    8.89.1.3 (Berkeley) 3/7/95";
  209.   #endif /* not lint */
  210.   
  211.   # include "sendmail.h"
  212. ***************
  213. *** 1402,1409 ****
  214.   int    opterr = 1;        /* if error message should be printed */
  215.   int    optind = 1;        /* index into parent argv vector */
  216.   #endif
  217. ! int    optopt;            /* character checked for validity */
  218. ! char    *optarg;        /* argument associated with option */
  219.   
  220.   #define BADCH    (int)'?'
  221.   #define EMSG    ""
  222. --- 1402,1409 ----
  223.   int    opterr = 1;        /* if error message should be printed */
  224.   int    optind = 1;        /* index into parent argv vector */
  225.   #endif
  226. ! int    optopt = 0;        /* character checked for validity */
  227. ! char    *optarg = NULL;        /* argument associated with option */
  228.   
  229.   #define BADCH    (int)'?'
  230.   #define EMSG    ""
  231. ***************
  232. *** 1543,1548 ****
  233. --- 1543,1551 ----
  234.       register char *p;
  235.       extern char *getusershell();
  236.   
  237. +     if (shell == NULL || shell[0] == '\0')
  238. +         return TRUE;
  239.       setusershell();
  240.       while ((p = getusershell()) != NULL)
  241.           if (strcmp(p, shell) == 0 || strcmp(p, WILDCARD_SHELL) == 0)
  242. ***************
  243. *** 1553,1558 ****
  244. --- 1556,1564 ----
  245.       register FILE *shellf;
  246.       char buf[MAXLINE];
  247.   
  248. +     if (shell == NULL || shell[0] == '\0')
  249. +         return TRUE;
  250.       shellf = fopen(_PATH_SHELLS, "r");
  251.       if (shellf == NULL)
  252.       {
  253. ***************
  254. *** 2190,2195 ****
  255. --- 2196,2203 ----
  256.   */
  257.   
  258.   #ifdef SOLARIS
  259. + extern int    h_errno;
  260.   
  261.   struct hostent *
  262.   solaris_gethostbyname(name)
  263. *** src/daemon.c.OLD    Thu Feb  9 17:28:51 1995
  264. --- src/daemon.c    Tue Feb 28 15:40:25 1995
  265. ***************
  266. *** 37,45 ****
  267.   
  268.   #ifndef lint
  269.   #ifdef DAEMON
  270. ! static char sccsid[] = "@(#)daemon.c    8.48.1.2 (Berkeley) 2/9/95 (with daemon mode)";
  271.   #else
  272. ! static char sccsid[] = "@(#)daemon.c    8.48.1.2 (Berkeley) 2/9/95 (without daemon mode)";
  273.   #endif
  274.   #endif /* not lint */
  275.   
  276. --- 37,45 ----
  277.   
  278.   #ifndef lint
  279.   #ifdef DAEMON
  280. ! static char sccsid[] = "@(#)daemon.c    8.48.1.4 (Berkeley) 2/28/95 (with daemon mode)";
  281.   #else
  282. ! static char sccsid[] = "@(#)daemon.c    8.48.1.4 (Berkeley) 2/28/95 (without daemon mode)";
  283.   #endif
  284.   #endif /* not lint */
  285.   
  286. ***************
  287. *** 995,1000 ****
  288. --- 995,1002 ----
  289.       int s;
  290.       int i;
  291.       EVENT *ev;
  292. +     int nleft;
  293. +     char ibuf[MAXNAME + 1];
  294.   #endif
  295.       static char hbuf[MAXNAME * 2 + 2];
  296.       extern char *hostnamebyanyaddr();
  297. ***************
  298. *** 1030,1036 ****
  299.       }
  300.   
  301.       /* create ident query */
  302. !     (void) sprintf(hbuf, "%d,%d\r\n",
  303.           ntohs(RealHostAddr.sin.sin_port), ntohs(la.sin.sin_port));
  304.   
  305.       /* create local address */
  306. --- 1032,1038 ----
  307.       }
  308.   
  309.       /* create ident query */
  310. !     (void) sprintf(ibuf, "%d,%d\r\n",
  311.           ntohs(RealHostAddr.sin.sin_port), ntohs(la.sin.sin_port));
  312.   
  313.       /* create local address */
  314. ***************
  315. *** 1068,1094 ****
  316.       }
  317.   
  318.       if (tTd(9, 10))
  319. !         printf("getauthinfo: sent %s", hbuf);
  320.   
  321.       /* send query */
  322. !     if (write(s, hbuf, strlen(hbuf)) < 0)
  323.           goto closeident;
  324.   
  325.       /* get result */
  326. !     i = read(s, hbuf, sizeof hbuf);
  327.       (void) close(s);
  328.       clrevent(ev);
  329. !     if (i <= 0)
  330.           goto noident;
  331. -     if (hbuf[--i] == '\n' && hbuf[--i] == '\r')
  332. -         i--;
  333. -     hbuf[++i] = '\0';
  334.   
  335.       if (tTd(9, 3))
  336. !         printf("getauthinfo:  got %s\n", hbuf);
  337.   
  338.       /* parse result */
  339. !     p = strchr(hbuf, ':');
  340.       if (p == NULL)
  341.       {
  342.           /* malformed response */
  343. --- 1070,1103 ----
  344.       }
  345.   
  346.       if (tTd(9, 10))
  347. !         printf("getauthinfo: sent %s", ibuf);
  348.   
  349.       /* send query */
  350. !     if (write(s, ibuf, strlen(ibuf)) < 0)
  351.           goto closeident;
  352.   
  353.       /* get result */
  354. !     p = &ibuf[0];
  355. !     nleft = sizeof(ibuf - 1);
  356. !     while ((i = read(s, p, nleft)) > 0)
  357. !     {
  358. !         p += i;
  359. !         nleft -= i;
  360. !     }
  361.       (void) close(s);
  362.       clrevent(ev);
  363. !     if (i < 0 || p == &ibuf[0])
  364.           goto noident;
  365.   
  366. +     if (*--p == '\n' && *--p == '\r')
  367. +         p--;
  368. +     *++p = '\0';
  369.       if (tTd(9, 3))
  370. !         printf("getauthinfo:  got %s\n", ibuf);
  371.   
  372.       /* parse result */
  373. !     p = strchr(ibuf, ':');
  374.       if (p == NULL)
  375.       {
  376.           /* malformed response */
  377. *** src/deliver.c.OLD    Sun Mar  5 08:28:25 1995
  378. --- src/deliver.c    Sun Mar  5 14:55:38 1995
  379. ***************
  380. *** 33,39 ****
  381.    */
  382.   
  383.   #ifndef lint
  384. ! static char sccsid[] = "@(#)deliver.c    8.84.1.1 (Berkeley) 2/10/95";
  385.   #endif /* not lint */
  386.   
  387.   #include "sendmail.h"
  388. --- 33,39 ----
  389.    */
  390.   
  391.   #ifndef lint
  392. ! static char sccsid[] = "@(#)deliver.c    8.84.1.3 (Berkeley) 3/5/95";
  393.   #endif /* not lint */
  394.   
  395.   #include "sendmail.h"
  396. ***************
  397. *** 1181,1186 ****
  398. --- 1181,1192 ----
  399.               extern char **environ;
  400.               extern int DtableSize;
  401.   
  402. +             if (e->e_lockfp != NULL)
  403. +             {
  404. +                 fclose(e->e_lockfp);
  405. +                 e->e_lockfp = NULL;
  406. +             }
  407.               /* child -- set up input & exec mailer */
  408.               (void) setsignal(SIGINT, SIG_IGN);
  409.               (void) setsignal(SIGHUP, SIG_IGN);
  410. ***************
  411. *** 2176,2183 ****
  412. --- 2182,2197 ----
  413.       {
  414.           /* child -- actually write to file */
  415.           struct stat stb;
  416. +         struct stat fsb;
  417.           MCI mcibuf;
  418. +         int oflags = O_WRONLY|O_APPEND;
  419.   
  420. +         if (e->e_lockfp != NULL)
  421. +         {
  422. +             fclose(e->e_lockfp);
  423. +             e->e_lockfp = NULL;
  424. +         }
  425.           (void) setsignal(SIGINT, SIG_DFL);
  426.           (void) setsignal(SIGHUP, SIG_DFL);
  427.           (void) setsignal(SIGTERM, SIG_DFL);
  428. ***************
  429. *** 2184,2190 ****
  430. --- 2198,2209 ----
  431.           (void) umask(OldUmask);
  432.   
  433.           if (stat(filename, &stb) < 0)
  434. +         {
  435.               stb.st_mode = FileMode;
  436. +             oflags |= O_CREAT|O_EXCL;
  437. +         }
  438. +         else if (bitset(0111, stb.st_mode))
  439. +             exit(EX_CANTCREAT);
  440.           mode = stb.st_mode;
  441.   
  442.           /* limit the errors to those actually caused in the child */
  443. ***************
  444. *** 2191,2198 ****
  445.           errno = 0;
  446.           ExitStat = EX_OK;
  447.   
  448. -         if (bitset(0111, stb.st_mode))
  449. -             exit(EX_CANTCREAT);
  450.           if (ctladdr != NULL)
  451.           {
  452.               /* ignore setuid and setgid bits */
  453. --- 2210,2215 ----
  454. ***************
  455. *** 2232,2241 ****
  456.           }
  457.           FileName = filename;
  458.           LineNumber = 0;
  459. !         f = dfopen(filename, O_WRONLY|O_CREAT|O_APPEND, FileMode);
  460.           if (f == NULL)
  461.           {
  462.               message("554 cannot open: %s", errstring(errno));
  463.               exit(EX_CANTCREAT);
  464.           }
  465.   
  466. --- 2249,2268 ----
  467.           }
  468.           FileName = filename;
  469.           LineNumber = 0;
  470. !         f = dfopen(filename, oflags, FileMode);
  471.           if (f == NULL)
  472.           {
  473.               message("554 cannot open: %s", errstring(errno));
  474. +             exit(EX_CANTCREAT);
  475. +         }
  476. +         if (fstat(fileno(f), &fsb) < 0 ||
  477. +             !bitset(O_CREAT, oflags) &&
  478. +              (stb.st_nlink != fsb.st_nlink ||
  479. +               stb.st_dev != fsb.st_dev ||
  480. +               stb.st_ino != fsb.st_ino ||
  481. +               stb.st_uid != fsb.st_uid))
  482. +         {
  483. +             message("554 cannot write: file changed after open");
  484.               exit(EX_CANTCREAT);
  485.           }
  486.   
  487. *** src/domain.c.OLD    Thu Feb  9 12:21:48 1995
  488. --- src/domain.c    Mon Mar  6 16:03:01 1995
  489. ***************
  490. *** 36,44 ****
  491.   
  492.   #ifndef lint
  493.   #if NAMED_BIND
  494. ! static char sccsid[] = "@(#)domain.c    8.19 (Berkeley) 3/11/94 (with name server)";
  495.   #else
  496. ! static char sccsid[] = "@(#)domain.c    8.19 (Berkeley) 3/11/94 (without name server)";
  497.   #endif
  498.   #endif /* not lint */
  499.   
  500. --- 36,44 ----
  501.   
  502.   #ifndef lint
  503.   #if NAMED_BIND
  504. ! static char sccsid[] = "@(#)domain.c    8.19.1.1 (Berkeley) 3/6/95 (with name server)";
  505.   #else
  506. ! static char sccsid[] = "@(#)domain.c    8.19.1.1 (Berkeley) 3/6/95 (without name server)";
  507.   #endif
  508.   #endif /* not lint */
  509.   
  510. ***************
  511. *** 709,714 ****
  512. --- 709,715 ----
  513.       fname = getenv("HOSTALIASES");
  514.       if (fname == NULL || (fp = fopen(fname, "r")) == NULL)
  515.           return NULL;
  516. +     setbuf(fp, NULL);
  517.       while (fgets(buf, sizeof buf, fp) != NULL)
  518.       {
  519.           for (p = buf; p != '\0' && !(isascii(*p) && isspace(*p)); p++)
  520. *** src/envelope.c.OLD    Thu Feb  9 12:21:46 1995
  521. --- src/envelope.c    Tue Feb 28 13:25:41 1995
  522. ***************
  523. *** 33,39 ****
  524.    */
  525.   
  526.   #ifndef lint
  527. ! static char sccsid[] = "@(#)envelope.c    8.34 (Berkeley) 4/14/94";
  528.   #endif /* not lint */
  529.   
  530.   #include "sendmail.h"
  531. --- 33,39 ----
  532.    */
  533.   
  534.   #ifndef lint
  535. ! static char sccsid[] = "@(#)envelope.c    8.34.1.1 (Berkeley) 2/28/95";
  536.   #endif /* not lint */
  537.   
  538.   #include "sendmail.h"
  539. ***************
  540. *** 489,495 ****
  541.           if (fd < 0)
  542.               syserr("!Can't open /dev/null");
  543.       }
  544. !     e->e_xfp = fdopen(fd, "w");
  545.       if (e->e_xfp == NULL)
  546.       {
  547.           syserr("!Can't create transcript stream %s", p);
  548. --- 489,495 ----
  549.           if (fd < 0)
  550.               syserr("!Can't open /dev/null");
  551.       }
  552. !     e->e_xfp = fdopen(fd, "a");
  553.       if (e->e_xfp == NULL)
  554.       {
  555.           syserr("!Can't create transcript stream %s", p);
  556. *** src/main.c.OLD    Fri Feb 10 09:40:49 1995
  557. --- src/main.c    Sun Mar  5 10:10:07 1995
  558. ***************
  559. *** 39,45 ****
  560.   #endif /* not lint */
  561.   
  562.   #ifndef lint
  563. ! static char sccsid[] = "@(#)main.c    8.55.1.3 (Berkeley) 2/10/95";
  564.   #endif /* not lint */
  565.   
  566.   #define    _DEFINE
  567. --- 39,45 ----
  568.   #endif /* not lint */
  569.   
  570.   #ifndef lint
  571. ! static char sccsid[] = "@(#)main.c    8.55.1.7 (Berkeley) 3/5/95";
  572.   #endif /* not lint */
  573.   
  574.   #define    _DEFINE
  575. ***************
  576. *** 293,299 ****
  577.   
  578.       for (i = j = 0; j < MAXUSERENVIRON && (p = envp[i]) != NULL; i++)
  579.       {
  580. !         if (strncmp(p, "FS=", 3) == 0 || strncmp(p, "LD_", 3) == 0)
  581.               continue;
  582.           UserEnviron[j++] = newstr(p);
  583.       }
  584. --- 293,299 ----
  585.   
  586.       for (i = j = 0; j < MAXUSERENVIRON && (p = envp[i]) != NULL; i++)
  587.       {
  588. !         if (strncmp(p, "IFS=", 4) == 0 || strncmp(p, "LD_", 3) == 0)
  589.               continue;
  590.           UserEnviron[j++] = newstr(p);
  591.       }
  592. ***************
  593. *** 324,330 ****
  594. --- 324,333 ----
  595.   
  596.   #if NAMED_BIND
  597.       if (tTd(8, 8))
  598. +     {
  599. +         res_init();
  600.           _res.options |= RES_DEBUG;
  601. +     }
  602.   #endif
  603.   
  604.       errno = 0;
  605. ***************
  606. *** 490,496 ****
  607.                   ExitStat = EX_USAGE;
  608.                   break;
  609.               }
  610. !             from = newstr(denlstring(optarg));
  611.               if (strcmp(RealUserName, from) != 0)
  612.                   warn_f_flag = j;
  613.               break;
  614. --- 493,499 ----
  615.                   ExitStat = EX_USAGE;
  616.                   break;
  617.               }
  618. !             from = newstr(denlstring(optarg, TRUE, TRUE));
  619.               if (strcmp(RealUserName, from) != 0)
  620.                   warn_f_flag = j;
  621.               break;
  622. ***************
  623. *** 571,576 ****
  624. --- 574,580 ----
  625.               break;
  626.   
  627.             case 'X':    /* traffic log file */
  628. +             setgid(RealGid);
  629.               setuid(RealUid);
  630.               TrafficLogFile = fopen(optarg, "a");
  631.               if (TrafficLogFile == NULL)
  632. ***************
  633. *** 654,659 ****
  634. --- 658,672 ----
  635.       }
  636.   
  637.       /*
  638. +     **  Initialize name server if it is going to be used.
  639. +     */
  640. + #if NAMED_BIND
  641. +     if (!bitset(RES_INIT, _res.options))
  642. +         res_init();
  643. + #endif
  644. +     /*
  645.       **  Process authorization warnings from command line.
  646.       */
  647.   
  648. ***************
  649. *** 730,736 ****
  650.   
  651.       /* full names can't have newlines */
  652.       if (FullName != NULL && strchr(FullName, '\n') != NULL)
  653. !         FullName = newstr(denlstring(FullName));
  654.   
  655.       /* do heuristic mode adjustment */
  656.       if (Verbose)
  657. --- 743,749 ----
  658.   
  659.       /* full names can't have newlines */
  660.       if (FullName != NULL && strchr(FullName, '\n') != NULL)
  661. !         FullName = newstr(denlstring(FullName, TRUE, TRUE));
  662.   
  663.       /* do heuristic mode adjustment */
  664.       if (Verbose)
  665. *** src/queue.c.OLD    Fri Feb 10 07:38:11 1995
  666. --- src/queue.c    Sun Mar  5 10:10:09 1995
  667. ***************
  668. *** 36,44 ****
  669.   
  670.   #ifndef lint
  671.   #ifdef QUEUE
  672. ! static char sccsid[] = "@(#)queue.c    8.41.1.1 (Berkeley) 2/10/95 (with queueing)";
  673.   #else
  674. ! static char sccsid[] = "@(#)queue.c    8.41.1.1 (Berkeley) 2/10/95 (without queueing)";
  675.   #endif
  676.   #endif /* not lint */
  677.   
  678. --- 36,44 ----
  679.   
  680.   #ifndef lint
  681.   #ifdef QUEUE
  682. ! static char sccsid[] = "@(#)queue.c    8.41.1.3 (Berkeley) 3/5/95 (with queueing)";
  683.   #else
  684. ! static char sccsid[] = "@(#)queue.c    8.41.1.3 (Berkeley) 3/5/95 (without queueing)";
  685.   #endif
  686.   #endif /* not lint */
  687.   
  688. ***************
  689. *** 210,216 ****
  690.   
  691.       /* message from envelope, if it exists */
  692.       if (e->e_message != NULL)
  693. !         fprintf(tfp, "M%s\n", denlstring(e->e_message));
  694.   
  695.       /* send various flag bits through */
  696.       p = buf;
  697. --- 210,216 ----
  698.   
  699.       /* message from envelope, if it exists */
  700.       if (e->e_message != NULL)
  701. !         fprintf(tfp, "M%s\n", denlstring(e->e_message, TRUE, FALSE));
  702.   
  703.       /* send various flag bits through */
  704.       p = buf;
  705. ***************
  706. *** 224,237 ****
  707.   
  708.       /* $r and $s and $_ macro values */
  709.       if ((p = macvalue('r', e)) != NULL)
  710. !         fprintf(tfp, "$r%s\n", denlstring(p));
  711.       if ((p = macvalue('s', e)) != NULL)
  712. !         fprintf(tfp, "$s%s\n", denlstring(p));
  713.       if ((p = macvalue('_', e)) != NULL)
  714. !         fprintf(tfp, "$_%s\n", denlstring(p));
  715.   
  716.       /* output name of sender */
  717. !     fprintf(tfp, "S%s\n", denlstring(e->e_from.q_paddr));
  718.   
  719.       /* output list of error recipients */
  720.       printctladdr(NULL, NULL);
  721. --- 224,237 ----
  722.   
  723.       /* $r and $s and $_ macro values */
  724.       if ((p = macvalue('r', e)) != NULL)
  725. !         fprintf(tfp, "$r%s\n", denlstring(p, TRUE, FALSE));
  726.       if ((p = macvalue('s', e)) != NULL)
  727. !         fprintf(tfp, "$s%s\n", denlstring(p, TRUE, FALSE));
  728.       if ((p = macvalue('_', e)) != NULL)
  729. !         fprintf(tfp, "$_%s\n", denlstring(p, TRUE, FALSE));
  730.   
  731.       /* output name of sender */
  732. !     fprintf(tfp, "S%s\n", denlstring(e->e_from.q_paddr, TRUE, FALSE));
  733.   
  734.       /* output list of error recipients */
  735.       printctladdr(NULL, NULL);
  736. ***************
  737. *** 240,246 ****
  738.           if (!bitset(QDONTSEND|QBADADDR, q->q_flags))
  739.           {
  740.               printctladdr(q, tfp);
  741. !             fprintf(tfp, "E%s\n", denlstring(q->q_paddr));
  742.           }
  743.       }
  744.   
  745. --- 240,246 ----
  746.           if (!bitset(QDONTSEND|QBADADDR, q->q_flags))
  747.           {
  748.               printctladdr(q, tfp);
  749. !             fprintf(tfp, "E%s\n", denlstring(q->q_paddr, TRUE, FALSE));
  750.           }
  751.       }
  752.   
  753. ***************
  754. *** 251,257 ****
  755.               (queueall && !bitset(QDONTSEND|QBADADDR|QSENT, q->q_flags)))
  756.           {
  757.               printctladdr(q, tfp);
  758. !             fprintf(tfp, "R%s\n", denlstring(q->q_paddr));
  759.               if (announce)
  760.               {
  761.                   e->e_to = q->q_paddr;
  762. --- 251,257 ----
  763.               (queueall && !bitset(QDONTSEND|QBADADDR|QSENT, q->q_flags)))
  764.           {
  765.               printctladdr(q, tfp);
  766. !             fprintf(tfp, "R%s\n", denlstring(q->q_paddr, TRUE, FALSE));
  767.               if (announce)
  768.               {
  769.                   e->e_to = q->q_paddr;
  770. ***************
  771. *** 427,433 ****
  772.       else
  773.           uname = pw->pw_name;
  774.   
  775. !     fprintf(tfp, "C%s:%s\n", uname, denlstring(a->q_paddr));
  776.   }
  777.   
  778.    /*
  779. --- 427,433 ----
  780.       else
  781.           uname = pw->pw_name;
  782.   
  783. !     fprintf(tfp, "C%s:%s\n", uname, denlstring(a->q_paddr, TRUE, FALSE));
  784.   }
  785.   
  786.    /*
  787. *** src/recipient.c.OLD    Mon Feb 20 17:31:39 1995
  788. --- src/recipient.c    Sun Mar  5 10:10:06 1995
  789. ***************
  790. *** 33,39 ****
  791.    */
  792.   
  793.   #ifndef lint
  794. ! static char sccsid[] = "@(#)recipient.c    8.44.1.4 (Berkeley) 2/20/95";
  795.   #endif /* not lint */
  796.   
  797.   # include "sendmail.h"
  798. --- 33,39 ----
  799.    */
  800.   
  801.   #ifndef lint
  802. ! static char sccsid[] = "@(#)recipient.c    8.44.1.6 (Berkeley) 3/5/95";
  803.   #endif /* not lint */
  804.   
  805.   # include "sendmail.h"
  806. ***************
  807. *** 111,117 ****
  808.           bufp = buf;
  809.       else
  810.           bufp = xalloc(i);
  811. !     strcpy(bufp, denlstring(list));
  812.   
  813.       for (p = bufp; *p != '\0'; )
  814.       {
  815. --- 111,117 ----
  816.           bufp = buf;
  817.       else
  818.           bufp = xalloc(i);
  819. !     strcpy(bufp, denlstring(list, FALSE, TRUE));
  820.   
  821.       for (p = bufp; *p != '\0'; )
  822.       {
  823. *** src/sendmail.h.OLD    Tue Mar  7 16:22:14 1995
  824. --- src/sendmail.h    Sun Mar  5 09:58:06 1995
  825. ***************
  826. *** 31,37 ****
  827.    * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  828.    * SUCH DAMAGE.
  829.    *
  830. !  *    @(#)sendmail.h    8.43.1.1 (Berkeley) 2/10/95
  831.    */
  832.   
  833.   /*
  834. --- 31,37 ----
  835.    * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  836.    * SUCH DAMAGE.
  837.    *
  838. !  *    @(#)sendmail.h    8.43.1.3 (Berkeley) 3/5/95
  839.    */
  840.   
  841.   /*
  842. ***************
  843. *** 41,47 ****
  844.   # ifdef _DEFINE
  845.   # define EXTERN
  846.   # ifndef lint
  847. ! static char SmailSccsId[] =    "@(#)sendmail.h    8.43.1.1        2/10/95";
  848.   # endif
  849.   # else /*  _DEFINE */
  850.   # define EXTERN extern
  851. --- 41,47 ----
  852.   # ifdef _DEFINE
  853.   # define EXTERN
  854.   # ifndef lint
  855. ! static char SmailSccsId[] =    "@(#)sendmail.h    8.43.1.3        3/5/95";
  856.   # endif
  857.   # else /*  _DEFINE */
  858.   # define EXTERN extern
  859. ***************
  860. *** 956,962 ****
  861.   extern char        *shortenstring __P((char *, int));
  862.   extern bool        usershellok __P((char *));
  863.   extern void        commaize __P((HDR *, char *, int, MCI *, ENVELOPE *));
  864. ! extern char        *denlstring __P((char *));
  865.   
  866.   /* ellipsis is a different case though */
  867.   #ifdef __STDC__
  868. --- 956,962 ----
  869.   extern char        *shortenstring __P((char *, int));
  870.   extern bool        usershellok __P((char *));
  871.   extern void        commaize __P((HDR *, char *, int, MCI *, ENVELOPE *));
  872. ! extern char        *denlstring __P((char *, int, int));
  873.   
  874.   /* ellipsis is a different case though */
  875.   #ifdef __STDC__
  876. *** src/util.c.OLD    Tue Feb 28 08:11:27 1995
  877. --- src/util.c    Sun Mar  5 10:10:07 1995
  878. ***************
  879. *** 33,39 ****
  880.    */
  881.   
  882.   #ifndef lint
  883. ! static char sccsid[] = "@(#)util.c    8.39.1.2 (Berkeley) 2/10/95";
  884.   #endif /* not lint */
  885.   
  886.   # include "sendmail.h"
  887. --- 33,39 ----
  888.    */
  889.   
  890.   #ifndef lint
  891. ! static char sccsid[] = "@(#)util.c    8.39.1.5 (Berkeley) 3/5/95";
  892.   #endif /* not lint */
  893.   
  894.   # include "sendmail.h"
  895. ***************
  896. *** 1485,1491 ****
  897.   {
  898.   #ifdef LOG
  899.       /* check for newlines and log if necessary */
  900. !     (void) denlstring(f);
  901.   #endif
  902.   
  903.       l--;
  904. --- 1485,1491 ----
  905.   {
  906.   #ifdef LOG
  907.       /* check for newlines and log if necessary */
  908. !     (void) denlstring(f, TRUE, TRUE);
  909.   #endif
  910.   
  911.       l--;
  912. ***************
  913. *** 1506,1511 ****
  914. --- 1506,1513 ----
  915.   **
  916.   **    Parameters:
  917.   **        s -- the input string
  918. + **        strict -- if set, don't permit continuation lines.
  919. + **        logattacks -- if set, log attempted attacks.
  920.   **
  921.   **    Returns:
  922.   **        A pointer to a version of the string with newlines
  923. ***************
  924. *** 1513,1520 ****
  925.   */
  926.   
  927.   char *
  928. ! denlstring(s)
  929.       char *s;
  930.   {
  931.       register char *p;
  932.       int l;
  933. --- 1515,1524 ----
  934.   */
  935.   
  936.   char *
  937. ! denlstring(s, strict, logattacks)
  938.       char *s;
  939. +     int strict;
  940. +     int logattacks;
  941.   {
  942.       register char *p;
  943.       int l;
  944. ***************
  945. *** 1521,1527 ****
  946.       static char *bp = NULL;
  947.       static int bl = 0;
  948.   
  949. !     if (strchr(s, '\n') == NULL)
  950.           return s;
  951.   
  952.       l = strlen(s) + 1;
  953. --- 1525,1535 ----
  954.       static char *bp = NULL;
  955.       static int bl = 0;
  956.   
  957. !     p = s;
  958. !     while ((p = strchr(p, '\n')) != NULL)
  959. !         if (strict || (*++p != ' ' && *p != '\t'))
  960. !             break;
  961. !     if (p == NULL)
  962.           return s;
  963.   
  964.       l = strlen(s) + 1;
  965. ***************
  966. *** 1538,1546 ****
  967.           *p++ = ' ';
  968.   
  969.   #ifdef LOG
  970. !     p = macvalue('_', CurEnv);
  971. !     syslog(LOG_ALERT, "POSSIBLE ATTACK from %s: newline in string \"%s\"",
  972. !         p == NULL ? "[UNKNOWN]" : p, bp);
  973.   #endif
  974.   
  975.       return bp;
  976. --- 1546,1557 ----
  977.           *p++ = ' ';
  978.   
  979.   #ifdef LOG
  980. !     if (logattacks)
  981. !     {
  982. !         syslog(LOG_NOTICE, "POSSIBLE ATTACK from %s: newline in string \"%s\"",
  983. !             RealHostName == NULL ? "[UNKNOWN]" : RealHostName,
  984. !             shortenstring(bp, 80));
  985. !     }
  986.   #endif
  987.   
  988.       return bp;
  989. *** src/version.c.OLD    Tue Feb 28 08:35:57 1995
  990. --- src/version.c    Tue Feb 28 11:11:00 1995
  991. ***************
  992. *** 33,39 ****
  993.    */
  994.   
  995.   #ifndef lint
  996. ! static char sccsid[] = "@(#)version.c    8.6.10.1 (Berkeley) 2/7/95";
  997.   #endif /* not lint */
  998.   
  999. ! char    Version[] = "8.6.10";
  1000. --- 33,39 ----
  1001.    */
  1002.   
  1003.   #ifndef lint
  1004. ! static char sccsid[] = "@(#)version.c    8.6.11.1 (Berkeley) 2/28/95";
  1005.   #endif /* not lint */
  1006.   
  1007. ! char    Version[] = "8.6.11";
  1008.